<?php
/**
 * Created by PhpStorm.
 * User: Lenovo
 * Date: 2018/7/23
 * Time: 10:30
 */

namespace App\Exports;

use App\Models\ProfitLogs;
use App\Models\Stores;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;    //设置标题

class StoreExport implements FromCollection,WithHeadings
{
    /*
     * Excel类的构造函数
     * 参数mid ：要导出的参会报名者的所属会议活动的id
     */
    public function __construct($params)
    {
        $this->params = $params;
    }

    //导出数据逻辑
    public function collection()
    {
        return Stores::exports($this->params);
    }

    //首行标题
    public function headings(): array
    {
        return [
            '店主',
            '店铺名',
            '擅长领域',
            '服务区域',
            '描述',
            '地址',
            '服务时间',
            '致电量',
            '成交量',
            '好评量',
            '优质',
            '热门',
            '首页推荐',
            '状态',
            '创建时间',
        ];
    }
}